<taglib name="sohtml" />
<div class="panel crm exfieldset" style="height:330px; width:700px;">
    <fieldset>
        <legend>客户查询</legend>
        <form action="{:U('Customer/dispatch_edit')}" method="get" id="frmSearch">
            <table class="table-form">
                <tr>
                    <td colspan="2">最后下单时间：<sohtml:sqlexpselect name="lastBuyTimeExpBegin" skips="IN,NEQ,LIKE" value="{$search.lastBuyTimeExpBegin}" /><input type="text" name="lastBuyTimeBegin" class="datepicker" size="10" value="{$search.lastBuyTimeBegin}" /> 且 <sohtml:sqlexpselect name="lastBuyTimeExpEnd" skips="IN,NEQ,LIKE" value="{$search.lastBuyTimeExpEnd}" /><input type="text" name="lastBuyTimeEnd" class="datepicker" size="10" value="{$search.lastBuyTimeEnd}" /></td>
                </td></tr>
                <tr>
                    <td colspan="2">最后联系时间：<sohtml:sqlexpselect name="lastVisitTimeExpBegin" skips="IN,NEQ,LIKE" value="{$search.lastVisitTimeExpBegin}" /><input type="text" name="lastVisitTimeBegin" class="datepicker" size="10" value="{$search.lastVisitTimeBegin}" /> 且 <sohtml:sqlexpselect name="lastVisitTimeExpEnd" skips="IN,NEQ,LIKE" value="{$search.lastVisitTimeExpEnd}" /><input type="text" name="lastVisitTimeEnd" class="datepicker" size="10" value="{$search.lastVisitTimeEnd}" /></td></td></tr>
                <tr>
                    <td>购买次数：<sohtml:sqlexpselect name="buyCountExp" skips="IN,NEQ,LIKE" value="{$search.buyCountExp}" /><input type="text" name="buyCount" size="5" value="{$search.buyCount}" />次</td>
                <td>&nbsp;累计消费：<sohtml:sqlexpselect name="cumulativeAmountExp" skips="IN,NEQ,LIKE" value="{$search.cumulativeAmountExp}" /><input type="text" name="cumulativeAmount" size="8" value="{$search.cumulativeAmount}" />元</td>
                </td></tr>
                <tr>
                    <td>原来工号：<input type="text" name="oldUsers" size="30" placeholder="多个工号之间以英文逗号隔开" value="{$search.oldUsers}" /></td>
                    <td>&nbsp;订单情况：<sohtml:select name="buyCountState" items="2=全部;0=无订单;1=有订单" value="{$search.buyCountState}" /></td>
                </td></tr>
                <tr>
                    <td>调度数量：<input type="text" name="searchNumber" placeholder="单次建议不超过1000个" value="{$search.searchNumber}" /></td><td><input type="submit" class="btn-search" value="查询" /><input type="button" class="button" value="重置" /></td></td></tr>
            </table>
        </form>
    </fieldset>
    <form action="{:U('Customer/dispatch_edit_save')}" method="post">
        <div style="width:300px; float:left; max-height: 130px; overflow-y: auto;">
            <table class="table-grid">
                <tr><th><input type="checkbox" class="chkAll" checked="checked" /></th><th class="col-idx"><a href="#" class="btn-arrowstop lnk-multiple" onclick="">&nbsp;</a></th><th>客户编号</th><th>客户姓名</th><th>购买次数</th></td></tr>
                <foreach name="list" item="vo">
                    <tr><td><input type="checkbox" name="ids[]" value="{$vo.id}/{$vo.userID}" checked="checked" /></td><td>{$key}</td><td>{$vo.serialNo}</td><td>{$vo.personalName}</td><td>{$vo.buyCount}</td></td></tr>
                </foreach>
            </table></div>
        <div style="width:280px; float:left; margin-left:10px;">
            <table class="table-form">
                <li style="font-size: 13px;">共<strong style="color:#F00; font-weight:bold; padding:0px 3px;">{$count}</strong>个客户, 其中有订单客户<strong style="color:#F00; font-weight:bold; padding:0px 3px;">{$hasOrderCount}</strong>个</td></tr>
                <tr>
                    <th>分配工号：</th><td>
                    <input type="text" name="newUsers" placeholder="多个工号之间以英文逗号隔开" size="30" />
                </td></tr>
                <tr><th>人均分配：</th><td>
                    <input type="text" name="perNumber" placeholder="不填则由系统后台分配" />
                </td></tr>
                <tr><th>备注信息：</th><td>
                    <input type="text" name="remark" placeholder="备注信息" />
                </td></tr>
            </table>
            <br />            
            <if condition="$upr['调度客户']">
                <input type="submit" value="立即分配"/>
            </if>
        </div>
        <div style="clear:both;"></div>
    </form>
</div>
<script type="text/javascript">
    resize_dialog(630);
    $('.notbreakline-ellipsis').hover(function () {
        $(this).attr('title', $(this).text());
    })
    var $frmSearch = $('#frmSearch');
    $frmSearch.find(':button').click(function () {
        $frmSearch.find('select option[value=""]').prop('selected', true);
        $frmSearch.find(':text').val('');
    })
</script>